package io;



import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.CollationElementIterator;
import java.util.ArrayList;
import java.util.Collection;

public class copy1 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("v12.jpg");
        FileOutputStream fos=new FileOutputStream("v34.jpg");

        int a;
        Collection<Integer> c=new ArrayList<>();
        while ((a= fis.read())!=-1){
            c.add(a);
        }
        String str =c.toString();
        StringBuffer str1=new StringBuffer(str);
        str1= str1.reverse();
        String str2=String.valueOf(str1);
        for (int i=0;i<str2.length();i++){
            int b=(int)str2.charAt(i);
            fos.write(b);
        }
        System.out.println("复制完毕");
        fis.close();
        fos.close();
    }
}
